using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Marmoset
{
    /// <summary>
    /// Utility class containing static methods for displaying dialogs.
    /// </summary>
    class Dialogs
    {
        /// <summary>
        /// Show an error message resulting from an exception.
        /// </summary>
        /// <param name="title">dialog title</param>
        /// <param name="message">message describing the operation that failed</param>
        /// <param name="e">an exception</param>
        public static void ShowErrorDialog(string title, string message, Exception e)
        {
            ShowErrorDialog(title, message + ": " + e.Message/* + "\n" + e.ToString()*/);
        }

        /// <summary>
        /// Show an error message.
        /// </summary>
        /// <param name="title">dialog title</param>
        /// <param name="message">message describing the operation that failed</param>
        public static void ShowErrorDialog(string title, string message)
        {
            MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        /// <summary>
        /// Show an information dialog.
        /// </summary>
        /// <param name="title">dialog title</param>
        /// <param name="message">message to show</param>
        public static void ShowInfoDialog(string title, string message)
        {
            MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}
